/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Feeds.java
 *
 * Created on 30/07/2011, 09:18:11 م
 */
package com.face;

import com.model.PayerComboModel;
import com.sql.PayerSql;
import java.util.Calendar;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import javax.swing.ImageIcon;

/**
 *
 * @author Khaled Lela
 */
public class Feeds extends javax.swing.JFrame {

    private Set<Integer> months;
    private int payerID;
    private int year;

    /** Creates new form Feeds */
    public Feeds() {
        initComponents();
        setIconImage(new ImageIcon(getClass().getResource("/images/icon.png")).getImage());
        setYears();
        setDays();
        Calendar cal = Calendar.getInstance();
        yearsCombo.setSelectedItem(cal.get(1));
        daysCombo.setSelectedIndex(cal.get(5));
        try{
        year = Integer.valueOf(yearsCombo.getSelectedItem() + "");
        }catch(Exception e){
          javax.swing.JOptionPane.showMessageDialog(rootPane, "من فضلك أضبط التاريخ", " خطأ فى التاريخ", javax.swing.JOptionPane.INFORMATION_MESSAGE);
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel5 = new javax.swing.JPanel();
        payerNameTF = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        payFeedButton = new javax.swing.JButton();
        jLabel17 = new javax.swing.JLabel();
        payerIDCombo = new javax.swing.JComboBox();
        daysCombo = new javax.swing.JComboBox();
        yearsCombo = new javax.swing.JComboBox();
        january = new javax.swing.JCheckBox();
        januaryDay = new javax.swing.JTextField();
        februaryDay = new javax.swing.JTextField();
        february = new javax.swing.JCheckBox();
        marchDay = new javax.swing.JTextField();
        march = new javax.swing.JCheckBox();
        aprilDay = new javax.swing.JTextField();
        april = new javax.swing.JCheckBox();
        mayDay = new javax.swing.JTextField();
        may = new javax.swing.JCheckBox();
        october = new javax.swing.JCheckBox();
        octoberDay = new javax.swing.JTextField();
        november = new javax.swing.JCheckBox();
        novemberDay = new javax.swing.JTextField();
        julyDay = new javax.swing.JTextField();
        july = new javax.swing.JCheckBox();
        september = new javax.swing.JCheckBox();
        septemberDay = new javax.swing.JTextField();
        august = new javax.swing.JCheckBox();
        augustDay = new javax.swing.JTextField();
        june = new javax.swing.JCheckBox();
        juneDay = new javax.swing.JTextField();
        december = new javax.swing.JCheckBox();
        decemberDay = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("تسديد الإشتراك");
        setResizable(false);

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "بيانات سداد المشترك", javax.swing.border.TitledBorder.RIGHT, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Traditional Arabic", 0, 18))); // NOI18N

        payerNameTF.setEditable(false);
        payerNameTF.setFont(new java.awt.Font("Traditional Arabic", 0, 18));
        payerNameTF.setHorizontalAlignment(javax.swing.JTextField.RIGHT);

        jLabel3.setFont(new java.awt.Font("Times New Roman", 0, 18));
        jLabel3.setText("مسلسل");

        payFeedButton.setFont(new java.awt.Font("Traditional Arabic", 0, 18));
        payFeedButton.setText("سدد");
        payFeedButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                payFeedButtonActionPerformed(evt);
            }
        });

        jLabel17.setFont(new java.awt.Font("Times New Roman", 0, 18));
        jLabel17.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel17.setText("الأسم");

        payerIDCombo.setFont(new java.awt.Font("Traditional Arabic", 0, 18));
        payerIDCombo.setModel(new PayerComboModel());
        payerIDCombo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                payerIDComboActionPerformed(evt);
            }
        });

        daysCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "اليوم" }));

        yearsCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "السنة" }));
        yearsCombo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                yearsComboActionPerformed(evt);
            }
        });

        january.setText("يناير");

        januaryDay.setEditable(false);
        januaryDay.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        februaryDay.setEditable(false);
        februaryDay.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        february.setText("فبراير    ");

        marchDay.setEditable(false);
        marchDay.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        march.setText("مارس  ");

        aprilDay.setEditable(false);
        aprilDay.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        april.setText("إبريل");

        mayDay.setEditable(false);
        mayDay.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        may.setText("مايو   ");

        october.setText("أكتوبر");

        octoberDay.setEditable(false);
        octoberDay.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        november.setText("نوفمبر");

        novemberDay.setEditable(false);
        novemberDay.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        julyDay.setEditable(false);
        julyDay.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        july.setText("يوليو");

        september.setText("سبتمبر");

        septemberDay.setEditable(false);
        septemberDay.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        august.setText("أغسطس");

        augustDay.setEditable(false);
        augustDay.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        june.setText("يونيه    ");

        juneDay.setEditable(false);
        juneDay.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        december.setText("ديسمبر");

        decemberDay.setEditable(false);
        decemberDay.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(payerNameTF, javax.swing.GroupLayout.PREFERRED_SIZE, 253, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel17)
                        .addGap(42, 42, 42)
                        .addComponent(payerIDCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel3))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addComponent(june)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(juneDay, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addComponent(december)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(decemberDay, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                                .addComponent(may)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(mayDay, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                                .addComponent(november)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(novemberDay, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addComponent(october)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(octoberDay, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addComponent(april)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(aprilDay, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                                .addComponent(september)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(septemberDay, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                                .addComponent(march)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(marchDay, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(february)
                            .addComponent(august))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(augustDay, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(februaryDay, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(july)
                            .addComponent(january))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(januaryDay, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(julyDay, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(14, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap(199, Short.MAX_VALUE)
                .addComponent(yearsCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(daysCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(209, 209, 209))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap(253, Short.MAX_VALUE)
                .addComponent(payFeedButton)
                .addGap(252, 252, 252))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(payerNameTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel17)
                    .addComponent(jLabel3)
                    .addComponent(payerIDCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(23, 23, 23)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(daysCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(yearsCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(26, 26, 26)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(august)
                            .addComponent(augustDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(february)
                        .addComponent(februaryDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addGap(26, 26, 26)
                                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(september)
                                    .addComponent(septemberDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(march)
                                .addComponent(marchDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(june)
                                    .addComponent(juneDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(december)
                                    .addComponent(decemberDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addGap(26, 26, 26)
                                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(november)
                                    .addComponent(novemberDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(may)
                                .addComponent(mayDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addGap(26, 26, 26)
                                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(october)
                                    .addComponent(octoberDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(april)
                                .addComponent(aprilDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addComponent(january)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(1, 1, 1)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addComponent(januaryDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(julyDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(july))))
                .addGap(18, 18, 18)
                .addComponent(payFeedButton, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void payFeedButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_payFeedButtonActionPerformed
        int PersonID = payerIDCombo.getSelectedIndex();
        int day = daysCombo.getSelectedIndex();

        for (int month : getMonths()) {
            new PayerSql().setPay(PersonID, year, month, day);
        }
}//GEN-LAST:event_payFeedButtonActionPerformed

    private void payerIDComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_payerIDComboActionPerformed
        if (!payerIDCombo.getSelectedItem().equals("")) {
            payerID = Integer.valueOf(payerIDCombo.getSelectedItem() + "");
            payerNameTF.setText(new PayerSql().getIDName(payerID));
            showPaiedMonths(new PayerSql().getPaiedMonths(payerID, year));
        } else {
            clearAll();
        }
    }//GEN-LAST:event_payerIDComboActionPerformed

    private void yearsComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_yearsComboActionPerformed
        year = Integer.valueOf(yearsCombo.getSelectedItem() + "");
    }//GEN-LAST:event_yearsComboActionPerformed
    private void setYears() {
        int i = 2011;
        while (i <= 2020) {
            yearsCombo.addItem(i++);
        }
    }

    private void setDays() {
        int i = 1;
        while (i <= 31) {
            daysCombo.addItem(i++);
        }
    }

    private Set<Integer> getMonths() {
        months = new HashSet<Integer>();
        if (january.isSelected() && january.isEnabled()) {
            months.add(1);
        }
        if (february.isSelected() && february.isEnabled()) {
            months.add(2);
        }
        if (march.isSelected() && march.isEnabled()) {
            months.add(3);
        }
        if (april.isSelected() && april.isEnabled()) {
            months.add(4);
        }
        if (may.isSelected() && may.isEnabled()) {
            months.add(5);
        }
        if (june.isSelected() && june.isEnabled()) {
            months.add(6);
        }
        if (july.isSelected() && july.isEnabled()) {
            months.add(7);
        }
        if (august.isSelected() && august.isEnabled()) {
            months.add(8);
        }
        if (september.isSelected() && september.isEnabled()) {
            months.add(9);
        }
        if (october.isSelected() && october.isEnabled()) {
            months.add(10);
        }
        if (november.isSelected() && november.isEnabled()) {
            months.add(11);
        }
        if (december.isSelected() && december.isEnabled()) {
            months.add(12);
        }
        return months;
    }

    private void showPaiedMonths(Map<Integer, Integer> monthDay) {
        Set<Integer> monthNum = monthDay.keySet();
        for (int num : monthNum) {
            switch (num) {
                case 1:
                    january.setSelected(true);
                    january.setEnabled(false);
                    januaryDay.setText(monthDay.get(1) + "");
                    break;
                case 2:
                    february.setSelected(true);
                    february.setEnabled(false);
                    februaryDay.setText(monthDay.get(2) + "");
                    break;
                case 3:
                    march.setSelected(true);
                    march.setEnabled(false);
                    marchDay.setText(monthDay.get(3) + "");
                    break;
                case 4:
                    april.setSelected(true);
                    april.setEnabled(false);
                    aprilDay.setText(monthDay.get(4) + "");
                    break;
                case 5:
                    may.setSelected(true);
                    may.setEnabled(false);
                    mayDay.setText(monthDay.get(5) + "");
                    break;
                case 6:
                    june.setSelected(true);
                    june.setEnabled(false);
                    juneDay.setText(monthDay.get(6) + "");
                    break;
                case 7:
                    july.setSelected(true);
                    july.setEnabled(false);
                    julyDay.setText(monthDay.get(7) + "");
                    break;
                case 8:
                    august.setSelected(true);
                    august.setEnabled(false);
                    augustDay.setText(monthDay.get(8) + "");
                    break;
                case 9:
                    september.setSelected(true);
                    september.setEnabled(false);
                    septemberDay.setText(monthDay.get(9) + "");
                    break;
                case 10:
                    october.setSelected(true);
                    october.setEnabled(false);
                    octoberDay.setText(monthDay.get(10) + "");
                    break;
                case 11:
                    november.setSelected(true);
                    november.setEnabled(false);
                    novemberDay.setText(monthDay.get(11) + "");
                    break;
                case 12:
                    december.setSelected(true);
                    december.setEnabled(false);
                    decemberDay.setText(monthDay.get(12) + "");
            }
        }
    }

    private void clearAll() {

        payerNameTF.setText("");

        january.setSelected(false);
        january.setEnabled(true);
        januaryDay.setText("");

        february.setSelected(false);
        february.setEnabled(true);
        februaryDay.setText("");

        march.setSelected(false);
        march.setEnabled(true);
        marchDay.setText("");

        april.setSelected(false);
        april.setEnabled(true);
        aprilDay.setText("");

        may.setSelected(false);
        may.setEnabled(true);
        mayDay.setText("");

        june.setSelected(false);
        june.setEnabled(true);
        juneDay.setText("");

        july.setSelected(false);
        july.setEnabled(true);
        julyDay.setText("");

        august.setSelected(false);
        august.setEnabled(true);
        augustDay.setText("");

        september.setSelected(false);
        september.setEnabled(true);
        septemberDay.setText("");

        october.setSelected(false);
        october.setEnabled(true);
        octoberDay.setText("");

        november.setSelected(false);
        november.setEnabled(true);
        novemberDay.setText("");

        december.setSelected(false);
        december.setEnabled(true);
        decemberDay.setText("");
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox april;
    private javax.swing.JTextField aprilDay;
    private javax.swing.JCheckBox august;
    private javax.swing.JTextField augustDay;
    private javax.swing.JComboBox daysCombo;
    private javax.swing.JCheckBox december;
    private javax.swing.JTextField decemberDay;
    private javax.swing.JCheckBox february;
    private javax.swing.JTextField februaryDay;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JCheckBox january;
    private javax.swing.JTextField januaryDay;
    private javax.swing.JCheckBox july;
    private javax.swing.JTextField julyDay;
    private javax.swing.JCheckBox june;
    private javax.swing.JTextField juneDay;
    private javax.swing.JCheckBox march;
    private javax.swing.JTextField marchDay;
    private javax.swing.JCheckBox may;
    private javax.swing.JTextField mayDay;
    private javax.swing.JCheckBox november;
    private javax.swing.JTextField novemberDay;
    private javax.swing.JCheckBox october;
    private javax.swing.JTextField octoberDay;
    private javax.swing.JButton payFeedButton;
    private javax.swing.JComboBox payerIDCombo;
    private javax.swing.JTextField payerNameTF;
    private javax.swing.JCheckBox september;
    private javax.swing.JTextField septemberDay;
    private javax.swing.JComboBox yearsCombo;
    // End of variables declaration//GEN-END:variables
}
